<template>

<div class="background">
  <YihenImageSlider :imgsList="imgsList"
    imgSize ="cover"
    width="80%"
    height="70%"
    itemTop="70%"
    itemLeft="60"
    @close = "goto('/')"
  ></YihenImageSlider>
</div>

</template>

<script setup>
import {useRouter , useRoute} from 'vue-router'
import  YihenImageSlider  from '../components/ImageSlider/Yihen-ImageSlider.vue'

const router = useRouter()
const route = useRoute()  // 获取上层路由传递的参数

// 1. 自动导入 weightRecord 文件夹下所有图片
const images = import.meta.glob('../assets/self-images/*.{png,jpg,jpeg,gif}', { eager: true })

// 2. 生成图片路径数组
const imgsList = Object.values(images).map(mod => mod.default)

function goto(name){
    //  路由跳转
    router.push({
        path: name, // 路由
    })
}

</script>

<style  scoped>
.background{
  height : 100vh;
  width : 100vw;
  background: radial-gradient(circle at 30% 30%, #5D7DB3 0%, #565879 100%);

}
</style>